#include "PacketWriter.h"
#include<arpa/nameser.h>
#include<net/ethernet.h>

class DNSResponder : public PacketWriter {

  public:
	DNSResponder(string* destination, string* device) : PacketWriter(device,LIBNET_RAW4) {
		if ((ipaddr = libnet_get_ipaddr4(lnet)) == -1) {
			cout << "couldn't get ipaddr: " << libnet_geterror(lnet) << endl;
			exit(1);
		}
		this -> destination = destination;
	};
	void writeResponse(ether_header* ether, ip* ipp, udphdr* udp, HEADER* dns, u_char* data, char* name, int datalen);

  protected:
	string* destination;
	ulong ipaddr;
};
